# Created by 黄景涛
# DATE 2024/5/7

import hashlib
import os


def calculate_md5(file_path):
    md5 = hashlib.md5()
    with open(file_path, 'rb') as f:
        while True:
            data = f.read(4096)
            if not data:
                break
            md5.update(data)
    return md5.hexdigest()


# file_path = 'data.txt'  # 文件路径
# md5_value = calculate_md5(file_path)
# print(f"{file_path}文件，MD5值为:【{md5_value}】")

paths = [os.path.join(os.getcwd(), 'host_template_2025-1-6.xlsx'),
         os.path.join(os.getcwd(), 'host_template_2025-1-7.xlsx')]

for p in paths:
    print(calculate_md5(p))
